﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
using Zeus.Thunder.Core;

namespace SharpTrainer.Other
{
    class ExtensionMethodTest : ITestCase
    {
        public void Run()
        {
            // create and populate ShoppingCart 
            IEnumerable<Product> products = new ShoppingCart
            {
                Products = new List<Product> {
                    new Product {Name = "Kayak", Category = "Watersports", Price = 275M},
                    new Product {Name = "Lifejacket", Category = "Watersports", Price = 48.95M},
                    new Product {Name = "Soccer ball", Category = "Soccer", Price = 19.50M},
                    new Product {Name = "Corner flag", Category = "Soccer", Price = 34.95M}
                }
            };
            
            decimal total = products.FilterByCategory("Soccer").TotalPrices();
            Console.WriteLine("Filtered total: {0:c}", total);
        }
    }
}
